
package com.hlkj.pay.gateway.order;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import javax.servlet.http.HttpServletRequest;

import com.hlkj.framework.common.pojo.CommonResult;
import com.hlkj.pay.dto.order.PayOrderChannelResultDto;
import com.hlkj.pay.dto.order.notify.CsOrderNotifyDto;
import com.hlkj.pay.infrastructure.model.common.CommonAppDO;
import com.hlkj.pay.infrastructure.model.order.PayOrderDO;
import com.hlkj.pay.infrastructure.model.pay.PayChannelRequestDO;
import com.hlkj.pay.infrastructure.model.pay.PayWayDO;
import com.hlkj.pay.infrastructure.model.pay.ProviderChannelConfigDO;

/**
 * @author HlpayTeam
 * @date 2024/11/06 13:28
 */
public interface IChannelPayOrderGateway {
    /**
     * 获取渠道订单号
     *
     * @param payOrderDO
     */
    CommonResult<String> channelOrderCode(PayOrderDO payOrderDO);
    /**
     *
     * @param payOrderDO
     * @return
     */
    PayOrderChannelResultDto submitChannelPayOrder(PayOrderDO payOrderDO);
    /**
     *
     * @param payOrderDO
     * @return
     */
    PayOrderChannelResultDto queryChannelPayOrder(PayOrderDO payOrderDO);

    /**
     *
     * @param payOrderDO
     * @return
     */
    PayOrderChannelResultDto queryChannelCloseOrder(PayOrderDO payOrderDO);
    /**
     *
     * @param payOrderDO
     * @return
     */
    PayOrderChannelResultDto closeChannelPayOrder(PayOrderDO payOrderDO);
   

    /**
     * 
     * @param channelCode
     * @param payWayDO
     * @return
     */
    String channelPayCode(String channelCode, PayWayDO payWayDO);
    /**
     *
     * @param channelCode
     * @param commonResult
     * @return
     */
    String callBackResponse(String channelCode, CommonResult commonResult);
    /**
     *
     * @param request
     * @param providerChannelConfigDO
     * @return
     */
    CommonResult<PayOrderChannelResultDto> orderStatusParse(HttpServletRequest request, ProviderChannelConfigDO providerChannelConfigDO);
    /**
     *
     * @param channelCode
     * @param request
     * @return
     */
    CommonResult<PayOrderChannelResultDto> orderStatusParse(String channelCode,HttpServletRequest request);

    CommonResult<PayOrderChannelResultDto> merAuthParse(HttpServletRequest request,String channelCode);

    CommonResult<CsOrderNotifyDto> csOrderStatusParse(HttpServletRequest request, ProviderChannelConfigDO providerChannelConfigDO);
    /**
     *
     * @param request
     * @param providerChannelConfigDO
     * @return
     */
    PayOrderDO closeOrderStatusParse(HttpServletRequest request, ProviderChannelConfigDO providerChannelConfigDO);

    /**
     *
     * @param payChannelRequestDO
     * @return
     */
    PayOrderChannelResultDto payInfoParse(PayChannelRequestDO payChannelRequestDO);
    /**
     *
     * @param channelCode
     * @return
     */
    boolean extensionExist(String channelCode);

    /**
     *
     * @param payOrderDO
     * @return
     */
    CommonAppDO queryChannelPayAppid(PayOrderDO payOrderDO);
}
